From dd6f104cdb5c5e60efb4e90ba44fcbdb43de62d8 Mon Sep 17 00:00:00 2001 From: "cl349@firebug.cl.cam.ac.uk" Date: Tue, 17 May 2005 09:04:32 +0000 Subject: [PATCH] bitkeeper revision 1.1421.1.1 (4289b3a0n7JmXiz6fiz0QAfqJ_M1Lg) XendDomainInfo.py: Redirect debug output to log. PrettyPrint.py: Add prettyprintstring. XendDomainInfo.py: Remove debug print. Signed-off-by: Christian Limpach --- tools/python/xen/xend/PrettyPrint.py | 10 ++++++++++ tools/python/xen/xend/XendDomainInfo.py | 7 +++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/tools/python/xen/xend/PrettyPrint.py b/tools/python/xen/xend/PrettyPrint.py index 9e91b11448..5fcc6e6d08 100644 --- a/tools/python/xen/xend/PrettyPrint.py +++ b/tools/python/xen/xend/PrettyPrint.py @@ -285,6 +285,16 @@ def prettyprint(sxpr, out=sys.stdout, width=80): sxp.show(sxpr, out=out) print >> out +def prettyprintstring(sxp): + class tmpstr: + def __init__(self): + self.str = "" + def write(self, str): + self.str = self.str + str + tmp = tmpstr() + prettyprint(sxp, out=tmp) + return tmp.str + def main(): pin = sxp.Parser() while 1: diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 1fdfd4ca5a..334a154460 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -28,7 +28,7 @@ from XendLogging import log from XendError import VmError from XendRoot import get_component -from PrettyPrint import prettyprint +from PrettyPrint import prettyprintstring """Flag for a block device backend domain.""" SIF_BLK_BE_DOMAIN = (1<<4) @@ -192,9 +192,8 @@ def vm_recreate(savedinfo, info): @param info: domain info from xc @type info: xc domain dict """ - print 'vm_recreate>' - print 'savedinfo=' ; prettyprint(savedinfo) - print 'info=', info + log.debug('savedinfo=' + prettyprintstring(savedinfo)) + log.debug('info=' + str(info)) vm = XendDomainInfo() vm.recreate = True vm.savedinfo = savedinfo -- 2.30.2